﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ElementumForever.Interfaces;

namespace ElementumForever
{
    class BaseComponent : IComponent
    {
        BaseActor _parent = null;
        bool _enable;

        public void OnRegister(BaseActor parent)
        { }

        public void OnUnregister()
        { }

        public bool Enable
        {
            get
            {
                return _enable;
            }
            set
            {
                SetEnable(value);
            }
        }

        protected virtual void SetEnable(bool enable) {
            _enable = enable;
        }

        public bool HasParent
        {
            get { return _parent != null; }
        }

        virtual public void OnUpdate(GameTime gameTime)
        { }

        virtual public void OnDraw(GameTime gameTime, SpriteBatch spriteBatch)
        { }
    }
}
